home *** CD-ROM | disk | FTP | other *** search
- import java.awt.Color;
- import java.awt.Graphics;
- import java.awt.Image;
- import java.net.URL;
-
- class ActiveMapLink {
- private ActiveMap applet;
- private Image highlighted;
- private Image selected;
- // $FF: renamed from: x int
- private int field_0;
- // $FF: renamed from: y int
- private int field_1;
- private int width;
- private int height;
- private URL url;
- private String frame;
- private String status = "";
- private int textx;
- private int texty;
- private String text = "";
- private Color textcolor;
- private int imagex;
- private int imagey;
- private Image image1;
- private boolean active;
- // $FF: renamed from: on boolean
- private boolean field_2;
-
- public ActiveMapLink(ActiveMap var1, int var2, int var3, int var4, int var5) {
- this.textcolor = Color.black;
- this.active = false;
- this.field_2 = false;
- this.applet = var1;
- this.field_0 = var2;
- this.field_1 = var3;
- this.width = var4;
- this.height = var5;
- }
-
- public void SetImages(Image var1, Image var2) {
- this.highlighted = var1;
- this.selected = var2;
- }
-
- public void SetInfo(URL var1, String var2, String var3) {
- this.url = var1;
- this.frame = var2;
- if (this.frame.equals("-")) {
- this.frame = null;
- }
-
- this.status = var3;
- if (this.status.equals("-")) {
- this.status = null;
- }
-
- if (this.status == null) {
- this.status = this.url != null ? this.url.toString() : "";
- }
-
- }
-
- public void SetText(int var1, int var2, String var3, Color var4) {
- this.textx = var1;
- this.texty = var2;
- this.text = var3;
- this.textcolor = var4;
- if (this.text == null) {
- this.text = "";
- }
-
- }
-
- public void SetImage(int var1, int var2, Image var3) {
- this.imagex = var1;
- this.imagey = var2;
- this.image1 = var3;
- }
-
- public void SetOn() {
- this.field_2 = true;
- }
-
- public void Draw(Graphics var1) {
- if (this.field_2 && this.selected != null) {
- var1.drawImage(this.selected, this.field_0, this.field_1, this.applet);
- } else if (this.active && this.highlighted != null) {
- var1.drawImage(this.highlighted, this.field_0, this.field_1, this.applet);
- }
-
- if (this.active) {
- var1.setColor(this.textcolor);
- var1.drawString(this.text, this.textx, this.texty);
- }
-
- if (this.active && this.image1 != null) {
- var1.drawImage(this.image1, this.imagex, this.imagey, this.applet);
- }
-
- }
-
- public void DoMouseDown() {
- if (this.applet.style == this.applet.cStayon) {
- this.field_2 = true;
- } else if (this.applet.style == this.applet.cExclusive) {
- this.field_2 = true;
- } else {
- this.field_2 = !this.field_2;
- }
-
- this.applet.repaint();
- if (this.field_2 && this.url != null) {
- if (this.frame != null) {
- this.applet.getAppletContext().showDocument(this.url, this.frame);
- return;
- }
-
- this.applet.getAppletContext().showDocument(this.url);
- }
-
- }
-
- public void DoMouseUp() {
- if (this.applet.style == this.applet.cExclusive) {
- this.field_2 = false;
- }
-
- }
-
- public void DoMouseEnter() {
- this.active = true;
- this.applet.showStatus(this.status);
- }
-
- public void DoMouseExit() {
- if (this.applet.style != this.applet.cStayactive) {
- this.active = false;
- }
-
- }
-
- public boolean MouseHit(int var1, int var2) {
- return var1 >= this.field_0 && var1 <= this.field_0 + this.width && var2 >= this.field_1 && var2 <= this.field_1 + this.height;
- }
- }
-